package com.weike.yuanding.config;

import com.alibaba.dashscope.aigc.generation.GenerationParam;
import jakarta.annotation.PostConstruct;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Arrays;

/**
 * @ClassName: AliConfig
 * @Author: YuanDing
 * @Date: 2025/4/23 20:38
 * @Description:
 */

@Data
@Configuration
@ConfigurationProperties(prefix = "ai.aliyun")
public class AliConfig {

    private String key;

    @Bean("r1")
    public GenerationParam generationParamR1() {
        return GenerationParam.builder()
                .apiKey(key)
                .model("deepseek-r1")
                .resultFormat(GenerationParam.ResultFormat.MESSAGE)
                .build();
    }

    @Bean("v3")
    public GenerationParam generationParamV3() {
        return GenerationParam.builder()
                .apiKey(key)
                .model("deepseek-v3")
                .resultFormat(GenerationParam.ResultFormat.MESSAGE)
                .build();
    }
}
